If you are writing code inside the main.py file to open the quiz.txt what would be the relative file path?

1
2
3
4
3

"quiz.txt"

When writing Python code, what is the absolute path to get to quiz.txt?

On a Mac, Macintosh HD is the root, on a PC it is usually the C:/ drive. So it might look like this:

1
2
3
4
5
2

open("/Users/my_project/quiz.txt")

If you are writing code inside main.py, what is the relative file path to open quiz.txt?


1
2
3
4
5
5

open("../my_files/quiz_files/quiz.txt")